#delimit;

set more off;

capture log close;

local t2="specify here the folder path where the data are stored";
local t1="specify here the folder path where you want the output data to be stored";

**This do-file allows you to sort files for each module for Wave 1 data;
log using `t1'sort_merge_w1rel231.log, replace;

drop _all;

set mem 200m;

use `t2'sharew1_rel2-3-1_cv_r;
compress;
sort hhid cvid;
drop if country==25; *Drop israel;
save `t1'sharew1_rel2-3-1_cv_r1, replace;
clear;

use `t2'sharew1_rel2-3-1_gv_health;
compress;
sort mergeid;
drop if country==25; *Drop israel;
save `t1'sharew1_rel2-3-1_gv_health1, replace;
clear;

use `t2'sharew1_rel2-3-1_gv_isced;
compress;
sort mergeid;
drop if country==25; *Drop israel;
save `t1'sharew1_rel2-3-1_gv_isced1, replace;
clear;


use `t2'sharew1_rel2-3-1_ch;
compress;
sort mergeid;
drop if country==25; *Drop israel;
save `t1'sharew1_rel2-3-1_ch1, replace;
clear;

use `t2'sharew1_rel2-3-1_dn;
compress;
sort mergeid;
drop if country==25;
save `t1'sharew1_rel2-3-1_dn1, replace;
clear;

use `t2'sharew1_rel2-3-1_ep;
compress;
sort mergeid;
drop if country==25;
save `t1'sharew1_rel2-3-1_ep1, replace;
clear;


use `t2'sharew1_rel2-3-1_ft;
compress;
sort mergeid;
drop if country==25;
save `t1'sharew1_rel2-3-1_ft1, replace;
clear;


use `t2'sharew1_rel2-3-1_hc;
compress;
sort mergeid;
drop if country==25;
save `t1'sharew1_rel2-3-1_hc1, replace;
clear;


use `t2'sharew1_rel2-3-1_hh;
compress;
sort mergeid;
drop if country==25;
save `t1'sharew1_rel2-3-1_hh1, replace;
clear;

use `t2'sharew1_rel2-3-1_ho;
compress;
sort mergeid;
drop if country==25;
save `t1'sharew1_rel2-3-1_ho1, replace;
clear;

use `t2'sharew1_rel2-3-1_mh;
compress;
sort mergeid;
drop if country==25;
save `t1'sharew1_rel2-3-1_mh1, replace;
clear;


use `t2'sharew1_rel2-3-1_ph;
compress;
sort mergeid;
drop if country==25;
save `t1'sharew1_rel2-3-1_ph1, replace;
clear;

use `t2'sharew1_rel2-3-1_sp;
compress;
drop if country==25;
sort mergeid;
save `t1'sharew1_rel2-3-1_sp1, replace;
clear;


use `t2'sharew1_rel2-3-1_gv_isced;
compress;
sort mergeid;
save `t1'sharew1_rel2-3-1_gv_isced1, replace;
clear;

use `t2'sharew1_rel2-3-1_imputations;
compress;
sort mergeid;
save `t1'sharew1_rel2-3-1_imputations1, replace;
clear;



log close;
